package main

import "time"

type NotifyUser struct {
	Name        string `json:"name"`
	LarkUnionID string `json:"lark_union_id"`
	LarkEmail   string `json:"lark_email"`
}

type AlertRule struct {
	ID                  int          `json:"id"`
	CreateUser          int          `json:"create_user"`
	CreateTime          time.Time    `json:"create_time"`
	Name                string       `json:"name"`
	Expr                string       `json:"expr"`
	Description         string       `json:"description"`
	ForValue            string       `json:"for_value"`
	Level               string       `json:"level"`
	IsActive            bool         `json:"is_active"`
	NotifyUsersDetail   []NotifyUser `json:"notify_users_detail"`
	NotifyGroupTestID   string       `json:"notify_group_test_id"`
	NotifyGroupTestName string       `json:"notify_group_test_name"`
	NotifyGroupProdID   string       `json:"notify_group_prod_id"`
	NotifyGroupProdName string       `json:"notify_group_prod_name"`
	GraphExpr           string       `json:"graph_expr"`
}

type PrometheusRuleGroups struct {
	Groups []PrometheusRuleGroup `yaml:"groups"`
}

type PrometheusRuleGroup struct {
	Name  string           `yaml:"name"`
	Rules []PrometheusRule `yaml:"rules"`
}

type PrometheusRule struct {
	Alert       string            `yaml:"alert"`
	Expr        string            `yaml:"expr"`
	For         string            `yaml:"for"`
	Labels      map[string]string `yaml:"labels"`
	Annotations map[string]string `yaml:"annotations"`
}
